{extend name='admin@main'}
{block name="button"}
{if auth("admin/fragment/add")}
<button data-open='{:url("add")}' data-title="添加碎片" class='layui-btn layui-btn-sm layui-btn-primary'>添加碎片</button>
{/if}
{if auth("admin/fragment/remove")}
<!--<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除轮播图</button>-->
{/if}
{/block}
{block name="content"}
<div class="think-box-shadow">
    {include file='fragment/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='text-left nowrap'>ID</th>
            <th class='text-left nowrap'>碎片名称</th>
            <th class="text-center">碎片类型</th>
            <th class="text-center nowrap">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='list-table-check-td think-checkbox'>
                <input class="list-check-box" value='{$vo.id}' type='checkbox'>
            </td>
            <td class='list-table-sort-td'>
                {$vo.id}
            </td>
            <td class='text-left nowrap'>
                {$vo.name}
            </td>
            <td class='text-center nowrap'>
                {$type[$vo.type]}
            </td>
            <td class='text-center  nowrap'>
                {if auth("admin/fragment/edit")}
                <a data-title="编辑碎片" class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
